#include<stdio.h>
int main()
{
    int n;
    scanf("%d",&n);

    int sum,p;
    sum=0;
    p=0;
    while(n>0){
        p=n%10;
        sum=sum+p;
        n=n/10;
    }
    printf("%d",sum);
    return 0;
}